-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[swift] New 'swift-combine' client generator for swift #15823
Conversation
thanks for the PR. can this be added to swift5 via the library option instead? currently the following is supported:
|
Hi, thanks for taking the time to improve openapi-generator. |
Hi @4brunu @wing328 and thanks for your feedback! I thought about updating current generator instead of creating new one, but it seemed too difficult for me to support all described above bullet points for existing swift generator (due to architecture change and bunch of existing library options to support) and do not break backward compatibility. How would you see a point about 'No static methods' might be integrated to the current generator? As I see there are several options:
|
Hi, I think we need to have an option to let people decide which one they want to use. |
Ok, so if we do not interested in new generator I may close this PR and open new one for 'No static methods' feature for existing generator once it's ready. |
I'm ok to accept it to give people another option and to try it out so as to collect more feedback. @4brunu and I suggested adding it to the existing swift5 generator since it's easier to maintain based on our experience. If it's too hard to add |
can you please update bitrise.yml to run tests for swift-combine petstore samples? |
@wing328 done |
the birise CI tests failed: https://app.bitrise.io/build/10f86487-ec07-44be-9058-5a5f7fe42535 can you please take a look when you've time? |
modules/openapi-generator/src/main/resources/swift-combine/api.mustache
Outdated
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/swift-combine/README.mustache
Outdated
Show resolved
Hide resolved
Sure, looks like I fixed it, but have no idea how to rerun bitrise pipelines. |
trigger a build in https://app.bitrise.io/build/5f640a77-25ad-42f1-bf05-e5d206ea804c. let's see how that goes |
bitrise tests passed via https://app.bitrise.io/build/5f640a77-25ad-42f1-bf05-e5d206ea804c |
successfully triggered a build failure too so all good @dydus0x14 can you please PM me via Slack when you've time? Thank you. |
circieci failure not related to this change. |
@@ -0,0 +1,817 @@ | |||
/* | |||
* Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) | |||
* Copyright 2018 SmartBear Software |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll remove this in another PR as it'a a new file
…15823) * swift-alt-gen init * swift-alt-gen in progress * swift-alt added runtime * swift-alt added transport * swift-alt added example * swift-alt v0.1.0 * swift-alt implemented form encoded body * swift-alt fixed array of enums to string * swift-alt v0.2.0 * swift-alt v0.3.0 * swift-alt v0.4.0 * swift-alt v0.5.0 * swift-alt v0.6.0 * swift-alt v0.7.0 * swift-alt v0.8.0 * swift-alt v0.9.0 * swift-alt v0.12.0 * swift-alt v0.13.0 * swift-alt v0.14.0 * swift-alt v0.15.0 * swift-alt v0.16.0 * swift-alt v0.17.0 * swift-alt v0.18.0 * swift-alt v0.19.0 Support for raw value in header * swift-alt v0.20.0 * swift-alt v0.21.0 * swift-alt v0.22.0 * swift-combine v0.23.0 * swift-combine PR rules adoption * swift-combine: updated transport * Updated bitrise.yml file * Fixed bitrise pipeline for swift-combine * Fixed code review comment
Hi @dydus0x14, why did you use Combine? It's basically dead, async/await should be used instead. Your basic idea is great, to have a solution without 3rd party dependencies, etc, so the question is, are you/your team planning to replace this approach? |
Hi @tivadarmolitorisz, thanks! Actually I implemented and used this generator for my project much earlier than WWDC 2023, so I had no idea about such move from Apple side😁 But I still decided to open source it because someone may still use Combine framework for like service layer in app. Now I do not have any plans to get away from Combine in my project, but it might be a great idea to create the similar Swift generator with async/await public signatures. So if you or your team is interested to use it, I can do it. |
@dydus0x14 we're interested in it, probably you should look for a new name for your generator (not |
iOS team of my current project used existing Swift generator for a year, but I decided to implement and open source an alternative solution to support critical features for our project:
Other nuances:
Examples: https://github.com/dydus0x14/openapi-generator-swift-combine
Some metrics: currently my iOS project contains 19 open api files (20k of YAML and JSON lines) and 25k lines of code generated by swift-combine generator.
Swift technical committee: @jgavris @ehyche @Edubits @jaz-ah @4brunu
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.For Windows users, please run the script in Git BASH.
master
(6.3.0) (minor release - breaking changes with fallbacks),7.0.x
(breaking changes without fallbacks)